﻿
namespace DataPacket
{
    public class DataPacketHelper
    {
        public static LoginDataPacket GetLoginDataPacket(string dataStr)
        {
            string str = "0007jxymnet~xym152103x";

            int usernameL = int.Parse(str.Substring(0, 4));

            LoginDataPacket ldp = new LoginDataPacket();

            ldp.UserName = str.Substring(4, usernameL);

            ldp.Password = str.Substring(4 + usernameL);

            return ldp;
        }
    }
}
